package com.yfp.operation.mapper;

import com.yfp.operation.domain.ComboPlanDevice;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yfp.operation.domain.vo.DeviceCurrentComboPlanRoadVO;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
* @author admin
* @description 针对表【combo_plan_device】的数据库操作Mapper
* @createDate 2024-04-24 17:07:44
* @Entity domain.com.yfp.operation.ComboPlanDevice
*/
public interface ComboPlanDeviceMapper extends BaseMapper<ComboPlanDevice> {

    List<DeviceCurrentComboPlanRoadVO> getByMachineIdAndDate(@Param("machineId") String machineId,@Param("currentTime") Timestamp currentTime);
    List<DeviceCurrentComboPlanRoadVO> getByMachineIdAndStartDateAndEndDate(@Param("machineId") String machineId,@Param("currentTime") Timestamp currentTime);
    /**
     * 批量插入
     * @param planDevices
     */
    void addAll(@Param("planDevices") List<ComboPlanDevice> planDevices);

    /**
     * 获取套餐计划关联的设备id
     * @param cPlanId
     * @return
     */
    List<String> getMachineIds(String cPlanId);

    /**
     * 根据套餐计划id获取设备信息
     * @param cPlanId
     * @return
     */
    List<ComboPlanDevice> getByCPlanId(String cPlanId);

    void deleteByPlanId(String planId);
    void deleteByCPlanId(String cplanId);

}


